<template>
  <el-card :shadow="shadow" :class="cardClass">
    <div v-if="extend" slot="header" class="header">
      <slot name="header"></slot>
    </div>
    <div v-else-if="name" slot="header" class="header">
      <span class="title"> <slot name="icon"></slot>{{ name }}</span>
      <slot name="tips"></slot>
    </div>
    <slot></slot>
  </el-card>
</template>
<script>
export default {
  props: {
    name: { type: String, default: "" },
    shadow: { type: String, default: "never" },
    cardClass: { type: String, default: "" },
    extend: { type: Boolean, default: false },
  },
};
</script>
<style lang="scss" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  .title {
    flex-shrink: 0;
  }
}
</style>
